﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ProcessManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ProcessManagement.ProcessParameterVMs
{
    public partial class ProcessParameterTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ProcessParameter._SetValue")]
        public ExcelPropety SetValue_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.SetValue);
        [Display(Name = "_Model._ProcessParameter._Precision")]
        public ExcelPropety Precision_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.Precision);
        [Display(Name = "_Model._ProcessParameter._Route")]
        public ExcelPropety Route_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.RouteId);
        [Display(Name = "_Model._ProcessParameter._Op")]
        public ExcelPropety Op_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.OpId);
        [Display(Name = "_Model._ProcessParameter._TagId")]
        public ExcelPropety TagId_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.TagId);
        [Display(Name = "_Model._ProcessParameter._ParameterName")]
        public ExcelPropety ParameterName_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.ParameterName);
        [Display(Name = "_Model._ProcessParameter._DataType")]
        public ExcelPropety DataType_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.DataType);
        [Display(Name = "_Model._ProcessParameter._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.Active);
        [Display(Name = "_Model._ProcessParameter._TagName")]
        public ExcelPropety TagName_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.TagName);
        [Display(Name = "_Model._ProcessParameter._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.ProductId);
        [Display(Name = "_Model._ProcessParameter._EquipmentId")]
        public ExcelPropety EquipmentId_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.EquipmentId);
        [Display(Name = "_Model._ProcessParameter._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.CreateTime, true);
        [Display(Name = "_Model._ProcessParameter._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ProcessParameter._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.CreateBy);
        [Display(Name = "_Model._ProcessParameter._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.UpdateBy);
        [Display(Name = "_Model._ProcessParameter._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.IsValid);
        [Display(Name = "_Model._ProcessParameter._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ProcessParameter>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Route_Excel.DataType = ColumnDataType.ComboBox;
            Route_Excel.ListItems = DC.Set<ProcessRoute>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());
            Op_Excel.DataType = ColumnDataType.ComboBox;
            Op_Excel.ListItems = DC.Set<ProcessRouteItem>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProcessParameterImportVM : BaseImportVM<ProcessParameterTemplateVM, ProcessParameter>
    {
            //import

    }

}